package xinxin.com.StatePattern.State.StateDetail;

import xinxin.com.StatePattern.State.State;
import xinxin.com.StatePattern.Work.Work;

/**
 * @author ：史鑫鑫
 * @date ：Created in 2019/3/26 10:58
 */
public class EveningState extends State {
    @Override
    public void WriteProgram(Work w) {
        if (w.isFinish()) {
            w.setState(new RestState());
            w.WriteProgram();
        } else {
            if (w.getHour() < 20) {
                System.out.println("当前时间：" + w.getHour() + "点 加班哦，疲惫之极");
            } else {
                w.setState(new OffdutyState());
                w.WriteProgram();
            }
        }
    }
}
